<template>
	<view class="point_container">
		<image src="../../static/index/jifen.png" mode=""></image>
		<view class="point_text">
			通证
		</view>
		<view class="point_jifen">
			{{memberInfo.virtual_coin}}
		</view>
		<view class="point_chongZhi" @click="goinvest">
			充值
		</view>
		<view class="point_duiHuan" @click="goexchange">
			兑换
		</view>
		<view class="point_zhuan" @click="gotransfer">
			转账
		</view>
	</view>
</template>

<script>
	import {getUser} from "../../api/user.js"
	export default{
		data(){
			return{
				memberInfo:{}
			}
		},
		onLoad() {
			this.getData()
		},
		onShow() {
			this.getData()
		},
		onNavigationBarButtonTap(e){
			uni.navigateTo({
				url:"/pages/tong/tongdetail"
			})
		},
		methods:{
			getData(){
				this.post(getUser,{
					user_id:uni.getStorageSync("userInfo").id
				}).then(res => {
						if(res.code == 1){
							this.memberInfo = res.data.member_info	
						}
				})
			},
			goinvest(){
				uni.navigateTo({
					url:'/pages/tong/tonginvest'
				})
			},
			goexchange(){
				uni.navigateTo({
					url:'/pages/tong/tongexchange'
				})
			},
			gotransfer(){
				uni.navigateTo({
					url:'/pages/tong/transfer'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.point_container{
		position: relative;
		text-align: center;
		image{
			margin-top: 142rpx;
			width: 88rpx;
			height: 88rpx;
		}
		.point_text{
			margin-top: 30rpx;
			font-size: 32rpx;
			font-weight: 700;
			color: #333333;
			opacity: 1;
		}
		.point_jifen{
			margin-top: 20rpx;
			font-size: 89rpx;
			font-weight: 400;
			color: #333333;
			opacity: 1;
		}
		.point_chongZhi{
			position: absolute;
			top: 789rpx;
			left: 50%;
			transform: translate(-50%,-50%);
			width: 324rpx;
			height: 88rpx;
			line-height: 88rpx;
			background: #008573;
			color: #FFFFFF;
			opacity: 1;
			border-radius: 8rpx;
		}
		.point_duiHuan{
			position: absolute;
			top: 914rpx;
			left: 50%;
			transform: translate(-50%,-50%);
			width: 324rpx;
			height: 88rpx;
			line-height: 88rpx;
			background: #EDEDED;
			color: #008573;
			opacity: 1;
			border-radius: 8rpx;
		}
		.point_zhuan{
			position: absolute;
			top: 1046rpx;
			left: 50%;
			transform: translate(-50%,-50%);
			width: 324rpx;
			height: 88rpx;
			line-height: 88rpx;
			background: #EDEDED;
			color: #008573;
			opacity: 1;
			border-radius: 8rpx;
		}
	}
</style>
